<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <section>
      <h3 class="page-sub-title"><?php the_title(); ?></h3>
      <div class="lead">
        <?php the_content(); ?>
      </div>
      <div class="gallery-list">
      <ul class="gallery">
        <?php
        $galleryObjs = get_post_gallery($post_id, FALSE);
        $ids = $galleryObjs[ids];
        $idsArr = explode(',', $ids);
        if ($idsArr && count($idsArr)) {
          foreach ($idsArr as $id) {
            $image = get_post($id);
            $image_attributes = wp_get_attachment_image_src($id, 'medium');
            $image_large_attributes = wp_get_attachment_image_src($id, 'large');
            ?>
            <li style="-webkit-animation: 0.8s; margin-bottom:6px;" data-animation="fadeInDown" class="animated fadeInDown">
              <a class="colorbox" href="<?php echo $image_large_attributes[0] ?>" title="<?php echo ($image->post_excerpt) ? $image->post_excerpt : the_title(); ?>" rel="social-activitie-image-<?php echo get_the_ID(); ?>">
                <span style="width:280px; height:186px; background:url(<?php echo $image_attributes[0]; ?>) no-repeat 0% 0% / cover; position:relative; opacity:1;"></span>
                <span style="width:280px;"><?php echo ($image->post_excerpt) ? $image->post_excerpt : the_title(); ?></span>
              </a>
            </li>
            <?php
          }
        }
        ?>
      </ul>
      </div>
    </section>
    <?php
  endwhile;
else:
  ?>
  <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php
endif;
?>
